const app = getApp();
Component({
  properties: {
    disabled: {
      type: Boolean
    }
  },
  data: {
    xhx_images: app.xhx_images,
  },
  methods: {
    navToSearch, //输入框不能输入，跳转到搜索页
    done, //确定
    search,//键盘搜索
    changeInput,//监听input值
    clearValue,//清空输入框
  }
})

function navToSearch(){
  const that = this;
  that.triggerEvent('navToSearch');
}

function done() {
  const that = this;
  that.triggerEvent('done');
}

function search(event) {
  const that = this;
  const value = event.detail.value;
  that.setData({
    keyword:value
  })
  that.triggerEvent('search',{value});
}

function changeInput(event){
  const that = this;
  const value = event.detail.value;
  that.setData({
    keyword: value
  })
}

function clearValue(){
  const that = this;
  console.log(111)
  that.setData({
    keyword: ""
  })
}